package com.plat.api.util;

/**
 * Created with IntelliJ IDEA.
 * User: shish
 * Date: 2020/11/3
 * Time: 17:09
 * Description: No Description
 */
public class Test {
    public static void main(String[] args) {
        String originUrlpath = "http://1258344707.vod2.myqcloud.com/1b87576bvodcq1258344707/d1c4d5305285890809382817017/playlist_eof.m3u8";
        String preUrlPath = originUrlpath.substring(0, originUrlpath.lastIndexOf("/")+1);
        String rootPath = "E:\\videodir";
        String fileName = "";
        HlsDownloader downLoader = new HlsDownloader(originUrlpath, preUrlPath, rootPath);
        downLoader.setThreadQuantity(10);
        try{
            fileName = downLoader.download(true);
        }
        catch (Exception e) {

        }

        if(fileName.isEmpty()){
            System.out.println("下载失败");
        }else{
            System.out.println(fileName);
            System.err.println("下载成功");
        }
    }
}
